package unit2;

public class Ex2_1_BasicTypeDemo {
    public static void main(String args[]) {
        byte a = 120;
        short b = 255;
        int c = 2200;
        long d = 8000;
        long l2 = 1234567890123L; //注意后缀L
//        long l2 = 1234567890123; //错误，没有后缀L
        float f, f2;
        double g = 123456789.123456789;
        b = a;
        c = (int)d; //强制性类型转换
        f = (float)g; //导致精度的损失
//        f2 = 123.4F; //注意后缀f
        f2 = 123.4F; //错误，默认是double类型
        System.out.print("a= " + a);
        System.out.println(" b= " + b);
        System.out.print(" c= " + c);
        System.out.println(" d= " + d);
        System.out.println("f= " + f);
        System.out.println("g= " + g);
    }
}
